"""
点击计数器
"""

import tkinter as tk

count = 0
def update_counter():
    global count
    count += 1
    counter_label.config(text=f"点击次数：{count}")


# 创建窗口
root = tk.Tk()
root.title("计数器")
root.geometry("400x400+1000+100")
# 计数器显示
counter_label = tk.Label(root, text="点击次数: 0",font={"宋体":20})
counter_label.pack(pady=20)
# 点击按钮
click_btn = tk.Button(root, text="点击", font={"宋体":20}, command=update_counter)
click_btn.pack()

root.mainloop()